
package com.forezp.exception;

public class CommonException extends RuntimeException {

	private static final long serialVersionUID = 8395410107054655842L;

	private ErrorCode errorCode;

	public CommonException(ErrorCode errorCode) {
		super(errorCode.getMsg());
		this.errorCode = errorCode;
	}

	public CommonException(ErrorCode errorCode, String msg) {
		super(msg);
		this.errorCode = errorCode;
	}

	public ErrorCode getErrorCode() {
		return errorCode;
	}

	public int getCode() {
		return errorCode.getCode();
	}

	public String getMsg() {
		return errorCode.getMsg();
	}
}